\(\int (a+b \sec ^2(e+f x)) \sin (e+f x) \, dx\) [4]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 24 \[ \int \left (a+b \sec ^2(e+f x)\right ) \sin (e+f x) \, dx=-\frac {a \cos (e+f x)}{f}+\frac {b \sec (e+f x)}{f} \]

[Out]

-a*cos(f*x+e)/f+b*sec(f*x+e)/f

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {4218, 14} \[ \int \left (a+b \sec ^2(e+f x)\right ) \sin (e+f x) \, dx=\frac {b \sec (e+f x)}{f}-\frac {a \cos (e+f x)}{f} \]

[In]

Int[(a + b*Sec[e + f*x]^2)*Sin[e + f*x],x]

[Out]

-((a*Cos[e + f*x])/f) + (b*Sec[e + f*x])/f

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 4218

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = F
reeFactors[Cos[e + f*x], x]}, Dist[-ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*((b + a*(ff*x)^n)^p/(ff*x)^(n*p
)), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n] && IntegerQ[p
]

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {b+a x^2}{x^2} \, dx,x,\cos (e+f x)\right )}{f} \\ & = -\frac {\text {Subst}\left (\int \left (a+\frac {b}{x^2}\right ) \, dx,x,\cos (e+f x)\right )}{f} \\ & = -\frac {a \cos (e+f x)}{f}+\frac {b \sec (e+f x)}{f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.46 \[ \int \left (a+b \sec ^2(e+f x)\right ) \sin (e+f x) \, dx=-\frac {a \cos (e) \cos (f x)}{f}+\frac {b \sec (e+f x)}{f}+\frac {a \sin (e) \sin (f x)}{f} \]

[In]

Integrate[(a + b*Sec[e + f*x]^2)*Sin[e + f*x],x]

[Out]

-((a*Cos[e]*Cos[f*x])/f) + (b*Sec[e + f*x])/f + (a*Sin[e]*Sin[f*x])/f

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.04

method result size
derivativedivides \(\frac {\sec \left (f x +e \right ) b -\frac {a}{\sec \left (f x +e \right )}}{f}\) \(25\)
default \(\frac {\sec \left (f x +e \right ) b -\frac {a}{\sec \left (f x +e \right )}}{f}\) \(25\)
parts \(-\frac {a \cos \left (f x +e \right )}{f}+\frac {b \sec \left (f x +e \right )}{f}\) \(25\)
parallelrisch \(\frac {-a \cos \left (2 f x +2 e \right )+\left (-2 a +2 b \right ) \cos \left (f x +e \right )-a +2 b}{2 f \cos \left (f x +e \right )}\) \(47\)
risch \(-\frac {a \,{\mathrm e}^{3 i \left (f x +e \right )}+\left (3 a -4 b \right ) \cos \left (f x +e \right )+i \left (a -4 b \right ) \sin \left (f x +e \right )}{2 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}\) \(59\)
norman \(\frac {\frac {2 a -2 b}{f}-\frac {2 \left (a +b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right ) \left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )}\) \(63\)

[In]

int((a+b*sec(f*x+e)^2)*sin(f*x+e),x,method=_RETURNVERBOSE)

[Out]

1/f*(sec(f*x+e)*b-a/sec(f*x+e))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.12 \[ \int \left (a+b \sec ^2(e+f x)\right ) \sin (e+f x) \, dx=-\frac {a \cos \left (f x + e\right )^{2} - b}{f \cos \left (f x + e\right )} \]

[In]

integrate((a+b*sec(f*x+e)^2)*sin(f*x+e),x, algorithm="fricas")

[Out]

-(a*cos(f*x + e)^2 - b)/(f*cos(f*x + e))

Sympy [F]

\[ \int \left (a+b \sec ^2(e+f x)\right ) \sin (e+f x) \, dx=\int \left (a + b \sec ^{2}{\left (e + f x \right )}\right ) \sin {\left (e + f x \right )}\, dx \]

[In]

integrate((a+b*sec(f*x+e)**2)*sin(f*x+e),x)

[Out]

Integral((a + b*sec(e + f*x)**2)*sin(e + f*x), x)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.04 \[ \int \left (a+b \sec ^2(e+f x)\right ) \sin (e+f x) \, dx=-\frac {a \cos \left (f x + e\right ) - \frac {b}{\cos \left (f x + e\right )}}{f} \]

[In]

integrate((a+b*sec(f*x+e)^2)*sin(f*x+e),x, algorithm="maxima")

[Out]

-(a*cos(f*x + e) - b/cos(f*x + e))/f

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.08 \[ \int \left (a+b \sec ^2(e+f x)\right ) \sin (e+f x) \, dx=-\frac {a \cos \left (f x + e\right )}{f} + \frac {b}{f \cos \left (f x + e\right )} \]

[In]

integrate((a+b*sec(f*x+e)^2)*sin(f*x+e),x, algorithm="giac")

[Out]

-a*cos(f*x + e)/f + b/(f*cos(f*x + e))

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.04 \[ \int \left (a+b \sec ^2(e+f x)\right ) \sin (e+f x) \, dx=-\frac {a\,\cos \left (e+f\,x\right )-\frac {b}{\cos \left (e+f\,x\right )}}{f} \]

[In]

int(sin(e + f*x)*(a + b/cos(e + f*x)^2),x)

[Out]

-(a*cos(e + f*x) - b/cos(e + f*x))/f